/*************************************************************************
	> File Name: main.c
	> Author: yas
	> Mail: rage_yas@hotmail.com
	> Created Time: Wed 14 May 2025 07:57:37 PM CST
 ************************************************************************/

#include<stdio.h>

#include "fun.h"

int main(void)
{
    int year;
    int month;

    scanf("%d",&year);
    scanf("%d",&month);

    printCalendar();
    
    int j = weekOfTheeFirstDay(year,month),k;
    for(k = 0;k < j;++k)
    {
        printf("    ");
    }
    int i;
    int days = daysOfTheMonth(year,month);
    for(i = 1;i <= days;++i)
    {
        if(0 != (i + j -1) % 7)
        {
            printf("%2d  ",i);
        }
        else
        {
            printf("\n%2d  ",i);
        }
    }
    puts("");
    return 0;
}